# 两个相同的序列才能相加

# 列表加列表，字符串加字符串 ， 元组加元组
list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
list2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]

list3 = list1 + list2  # 拼接[1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0]

print(list3)

# 元组
tuple1 = (1, 2, 3, 4, 5, 6, 7, 8, 9, 0)
tuple2 = (1, 2, 3, 4,)
tuple3 = tuple1 + tuple2  # 拼接
print(tuple3)

# 字符串
str1 = 'he'
str2 = 'llo'  # hello
str3 = str1 + str2
print(str3)
# 不能不同类型的相加，报错了
# result = list2 + str1#an only concatenate list (not "str") to list
# print(result)